﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace LdtJudge.DataEngine.Model.XMLConfigModel.XmlCode
{
    [Serializable]
    [XmlRootAttribute("root", IsNullable = false)]
    public class XmlCodeModel
    {
        [XmlElementAttribute("rulemodel")]
        public List<Rulemodel> RulemodelList { get; set; }
    }

    public class Rulemodel
    {
        /// <summary>
        /// 操作数据类型 1：分析后的案件要素中心，2：分析后的案由要素信息，3：案件要素中心优选结果，4：案由要素中心与分人员要素优选结果 5：案由要素中心与分人员要素优选结果和合并后结果。
        /// </summary>
        [XmlAttribute("type")]
        public string Type { get; set; }

        /// <summary>
        /// 操作单元
        /// </summary>
        [XmlElementAttribute("rule")]
        public List<RunleItem> RunleItemList { get; set; }

        /// <summary>
        /// 条件加载数据
        /// </summary>
        [XmlElementAttribute("element")]
        public List<ElementModel> ElementModelList { get; set; }
    }

    public class ElementModel
    {
        /// <summary>
        /// 条件编号
        /// </summary>
        [XmlAttribute("cname")]
        public string Cname { get; set; }

        /// <summary>
        /// 查询路径
        /// </summary>
        [XmlAttribute("path")]
        public string Path { get; set; }

        /// <summary>
        /// 获取属性名称
        /// </summary>
        [XmlAttribute("name")]
        public string Name { get; set; }

        [XmlAttribute("type")]
        public string type { get; set; }
    }

    public class RunleItem
    {
        /// <summary>
        /// 查询路径
        /// </summary>
        [XmlAttribute("path")]
        public string Path { get; set; }

        /// <summary>
        /// 操作类型 1:不为空则成功2：数量相同则成功
        /// </summary>
        [XmlAttribute("type")]
        public string Type { get; set; }

        [XmlAttribute("exp")]
        public string exp { get; set; }

        [XmlAttribute("count")]
        public string Count { get; set; }

        [XmlAttribute("nocount")]
        public string NoCount { get; set; }

        [XmlElementAttribute("rule")]
        public RunleItem Runle { get; set; }


    }
}
